package com.googlecode.gwtbb.client.only.widget.basic;

import com.google.gwt.user.client.ui.FormHandlerCollection;

/**
 * @author Abraham Grief
 * @version $Id$
 * @since Apr 30, 2008
 */
public class AsyncFileUploadListenerCollection extends FormHandlerCollection {
	public AsyncFileUploadErrorEvent fireOnError(Object source, String errorInfo) {
		AsyncFileUploadErrorEvent event = new AsyncFileUploadErrorEvent(source, errorInfo);
		for (Object o : this) {
			AsyncFileUploadListener listener = (AsyncFileUploadListener)o;
			listener.onError(event);
		}
		return event;
	}

	public AsyncFileUploadValidateFileNameEvent fireOnValidateFileName(Object source, String fileName) {
		AsyncFileUploadValidateFileNameEvent event = new AsyncFileUploadValidateFileNameEvent(source, fileName);
		for (Object o : this) {
			AsyncFileUploadListener listener = (AsyncFileUploadListener)o;
			listener.onValidateFileName(event);
		}
		return event;
	}
}
